﻿using System;

using Framework.Common;

using Microsoft.Practices.EnterpriseLibrary.Validation;

namespace Framework.Domain.Validation.Vab
{
    /// <summary>
    /// Provides base functional for domain objects validation using Validation Application Block.
    /// </summary>
    public abstract class VabDomainObjectValidator : Validator
    {
        private readonly IContainerResolver containerResolver = ContainerResolverProvider.Instance;

        /// <summary>
        /// Initializes a new instance of the <see cref="VabDomainObjectValidator"/> class.
        /// </summary>
        /// <param name="messageTemplate">The message template.</param>
        /// <param name="tag">The tag.</param>
        protected VabDomainObjectValidator(string messageTemplate, string tag)
            : base(messageTemplate, tag)
        {
        }

        /// <summary>
        /// Gets the <see cref="IContainerResolver" /> instance.
        /// </summary>
        protected IContainerResolver ContainerResolver
        {
            get
            {
                return containerResolver;
            }
        }

        /// <inheritdoc />
        protected override string DefaultMessageTemplate
        {
            get
            {
                return String.Empty;
            }
        }
    }
}
